{%extends "base.html"%}
{%block body%}
{%load highlight%}
<div id="content" class="entry_{{entry.key.id}}">
<h2 id="eh2">{{entry.name}}</h2>
{%ifequal entry.type 1%}
<p class="entry_date"> {{entry.created|date:"Y/m/d H:i:s"}} by {{entry.giver}}</p>
{%endifequal%}
<div id="entry_content_body">
{{entry.description|pygmentize}}
</div>

{%ifequal entry.type 1%}
<div>
<ol id="comments">
{%for comment in comments%}
<li>
<span class="comment_date">
{{comment.created|date:"Y/m/d H:i:s"}} by {{comment.giver.nickname}}
</span>
<span class="comment">{{comment.content|striptags}}</span>
</li>
{%endfor%}
</ol>
</div>

{%if user%}
<div>
<form action="" method="post">
<fieldset>
  <legend>Add a comment</legend>
  <input type="hidden" name="post" value="{{entry.key}}" />
  <p><textarea name="comment" id="id_comment" rows="5" cols="25"></textarea></p>
  <p><input type="submit" value="Add"/></p>
</fieldset>
</form>

</div>
{%else%}
<div><a href="{{sign_in}}">Sign in</a> to add a comment.</div>
{%endif%}

{%endifequal%}
</div>

{%endblock%}
